<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<link rel="stylesheet" type="text/css"
	href="<%=path%>/css/easyui.css">
<link rel="stylesheet" type="text/css"
	href="<%=path%>/css/icon.css">
<link rel="stylesheet" type="text/css"
	href="<%=path%>/css/demo.css">
<link rel="stylesheet" href="<%=path%>/css/bootstrap.min.css" />
<link rel="stylesheet" href="<%=path%>/css/easyui.css" />
<script type="text/javascript" src="<%=path%>/js/js_add/jquery-1.8.3.js"></script>
<script type="text/javascript" src="<%=path%>/js/js_add/jquery-ui.js"></script>
<script type="text/javascript" src="<%=path%>/js/js_add/jquery.ui.tabs.js"></script>
<script type="text/javascript" src="<%=path%>/js/jquery.easyui.min.js"></script>

<script type="text/javascript">
	$(function() {
		$("#dg").datagrid({
			url : '<%=path%>/type/getAllPType',
			singleSelect: true,//单选效果
			//iconCls: 'icon-search',
			rownumbers : true,
			pagination : true,//显示底部分页栏
			pageSize : 4,//默认每页记录数
			pageList : [ 2, 4, 6 ],
			fitColumns : true,//自适应宽度，防止水平滚动
			striped : true,//隔行变色
			
			toolbar:[],columns : [ [ {field : 'ck',checkbox : true}, 
        {field : 'fid',	title : '项目类型编号',width : 60}, 
        {field : 'fname',title : '项目名称',align : 'center',width : 40},

        
        {field : 'def',title : '操作',align : 'center',width : 40,
                formatter:function(value,rec){ 
                var btn = '<a id="bbt" class="editcls" style="color:#008080" onclick="javascript:look('+rec.fid+');">详情</a>';  
                return btn;	}} ]],
			loadMsg : "正努力为您加载中......"
		});

	});
	function look(fid){
	//alert(fid+'进入look方法了');
	   location.href="<%=path%>/type/getAllPType2?FId="+fid;
	   //location.href="<%=path%>/type/getAllPType3?FId="+fid;
	   //$('#dlg').dialog('open').window('center');
	}
	
</script>


</head>

<body>
    <div id="dlg" class="easyui-dialog" title="Toolbar and Buttons"
				style="width:600px;height:400px;padding:20px"
				data-options="
			    closed:true,
				toolbar: [{
					text:'保存',
					iconCls:'icon-add',
					closed:true,
					handler:function(){
						alert('save')
					}
				},'-',{
					text:'删除',
					iconCls:'icon-remove',
					handler:function(){
						alert('remove');
						location.reload();
					}
				},'-',{
					text:'修改',
					iconCls:'icon-edit',
					handler:function(){
						alert('remove');
						location.reload();
					}
				}]
			">


				The dialog content.

				<form>
				<table>
				    <c:forEach items="${psTypeD }" var="p">
				     <tr>
				         <td>${p.SName }</td>
				     </tr>
				    </c:forEach>
				</table>   
					<!-- 请输入用户名:<input name="name" /> <input type="submit" /> <input
						type="reset" /> -->
				</form>
				<!-- <script type="text/javascript">
				$(document).ready(function(){
                   setTimeout(function(){
                   alert("页面加载结束后2秒钟时弹出！");
                   },2000);
                });
				</script> -->
			</div>
	<div id="grid" >
		<table id="dg" title="项目类别管理列表">
		</table>
	</div>
	
</body>
</html>
